﻿// RotationAxis
// Object representing rotation axis
// 
// FLMScan - Featured by FabLab Munich

using System;
using FLMScan.Geometry;
using FLMScan.Parameters;

namespace FLMScan.WorldCoordinateReconstruction.Riedmaier
{
    class RotationAxis
    {
        RotationAxisParameters rotationAxisParameters;
        private double absoluteValue;

        public RotationAxis(RotationAxisParameters parameters)
        {
            rotationAxisParameters = parameters;

            absoluteValue = Math.Sqrt(rotationAxisParameters.X * rotationAxisParameters.X
                + rotationAxisParameters.Z * rotationAxisParameters.Z);                                   
        }

        public double X
        {
            get { return rotationAxisParameters.X; }
        }

        public double Y
        {
            get { return rotationAxisParameters.Y; }
        }

        public double Z
        {
            get { return rotationAxisParameters.Z; }
        }

        public double GetPointDistance(FlmPoint point)
        {
            double pointAbsoluteValue = Math.Sqrt(point.X * point.X + point.Z * point.Z);
            return absoluteValue - pointAbsoluteValue;            
        }
    }
}
